package com.tllq.zhongkang.entity;

import lombok.Data;

import java.io.Serializable;

/**
 * 统一返回格式
 */
@Data
public class ResultMap implements Serializable {
    private static final long serialVersionUID = -3041049173456238298L;
    private Integer code;
    private String msg;
    private Object Data;

    public ResultMap(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        Data = data;
    }

    public ResultMap(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static ResultMap ok (Object object){
      return   new ResultMap(200,"success",object);
    }

    public static ResultMap error(String datamsg){
        return new ResultMap(3000,"发生错误",datamsg);
    }
}
